{include file="/shopro/common/script" /}

<div id="index" class="user-index panel panel-default panel-intro" v-cloak>
    <el-container class="panel-block">
        <el-header class="sa-header">
            <div class="sa-title sa-flex sa-row-between">
                <div class="sa-title-left">
                    <div class="left-name">货款明细</div>
                    <sa-filter-condition v-model="state.filter" @filter-delete="onChangeFilter">
                    </sa-filter-condition>
                </div>
                <div class="sa-title-right">
                    <el-button class="sa-button-refresh" icon="RefreshRight" @click="getData"></el-button>
                    <el-button class="sa-button-refresh" icon="Search" @click="onOpenFilter"></el-button>
                </div>
            </div>
        </el-header>
        <el-main class="sa-main">
            <el-table height="100%" class="sa-table" :data="state.data" stripe @sort-change="onChangeSort">
                <el-table-column prop="id" label="ID" min-width="90" sortable="custom"> </el-table-column>
                <el-table-column label="用户信息" min-width="150">
                    <template #default="scope">
                        <sa-user-profile :user="scope.row.user" :id="scope.row.user.id"></sa-user-profile>
                    </template>
                </el-table-column>
                <el-table-column prop="amount" label="变动余额" min-width="120"></el-table-column>
                <el-table-column prop="before" label="变更前" min-width="120"></el-table-column>
                <el-table-column prop="after" label="剩余余额" min-width="120"></el-table-column>
                <el-table-column label="操作人" min-width="160">
                    <template #default="scope">
                        <sa-user-profile type="oper" :user="scope.row.oper" :id="scope.row.oper_id">
                        </sa-user-profile>
                        </sa-user-profile>
                    </template>
                </el-table-column>
                <el-table-column prop="createtime" label="交易时间" min-width="172"></el-table-column>
                <el-table-column label="备注" min-width="160">
                    <template #default="scope">
                        {{ scope.row.event_text }}{{ scope.row.memo ? ':' + scope.row.memo : '' }}
                    </template>
            </el-table>
        </el-main>
        <el-footer class="sa-footer sa-flex sa-row-right">
            <sa-pagination v-model="pagination" @pagination-change="getData"></sa-pagination>
        </el-footer>
    </el-container>
    <sa-filter v-model="state.filter" @filter-change="onChangeFilter"></sa-filter>
</div>